<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    let arr = [2, 6, 1, 77, 52, 25, 7]
    let arr_max = arr[0]
    let arr_min = arr[0]
    for (i = 0; i < arr.length; i++) {
      if (arr[i] > arr_max) {
        arr_max = arr[i]
      } else if (arr[i] < arr_min) {
        arr_min = arr[i]
      }
    }
    document.write(`这个数组的最大值是${arr_max}<br>`)
    document.write(`这个数组的最小值是${arr_min}<br>`)
  </script>
</body>

</html>